package cn.rdq.iknessplatform.service.impl;

import cn.rdq.api.dto.BlogCommentInfoDto;
import cn.rdq.api.dto.BlogDetailDto;
import cn.rdq.api.po.Blog;
import cn.rdq.api.po.BlogComment;
import cn.rdq.dao.BlogCommentMapper;
import cn.rdq.iknessplatform.service.BlogCommentService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BlogCommentServiceImpl extends ServiceImpl<BlogCommentMapper, BlogComment> implements BlogCommentService {

    @Autowired
    private BlogCommentMapper blogCommentMapper;

    @Override
    public List<BlogCommentInfoDto> rootComment(Long blogId) {
        return blogCommentMapper.listRootComment(blogId);
    }

    @Override
    public List<BlogCommentInfoDto> replys(Long rootParentId) {
        return blogCommentMapper.listByRootCommentId(rootParentId);
    }

}
